package com.qcby.Controller;

import com.qcby.Entity.TrainOrder;
import com.qcby.Service.TrainOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/TrainOrder")
public class TrainOrderController {

    @Autowired
    private TrainOrderService trainOrderService;

    @CrossOrigin
    @RequestMapping("/getTrainOrderByTrainIdAndCarriageNum")
    public List<TrainOrder> getTrainOrderByTrainIdAndCarriageNum(int id,int carriageNum){
        return trainOrderService.getTrainOrderByTrainIdAndCarriageNum(id,carriageNum);
    }
}
